package com.dongdongshop.service.impl;

import com.dongdongshop.mapper.TbContentCategoryMapper;
import com.dongdongshop.pojo.TbContent;
import com.dongdongshop.pojo.TbContentCategory;
import com.dongdongshop.service.CategoryContentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@com.alibaba.dubbo.config.annotation.Service
public class CategoryContentServiceImpl implements CategoryContentService {

    @Autowired
    private TbContentCategoryMapper tbContentCategoryMapper;

    @Override
    public List<TbContentCategory> selectAll() {
        List<TbContentCategory> list = tbContentCategoryMapper.selectByExample(null);
        return list;
    }

    @Override
    public List<TbContentCategory> findAll() {
        List<TbContentCategory> tbContentCategories = tbContentCategoryMapper.selectByExample(null);
        return tbContentCategories;
    }

    @Override
    public TbContentCategory selectById(Long id) {
        TbContentCategory tbContentCategory = tbContentCategoryMapper.selectByPrimaryKey(id);
        return tbContentCategory;
    }

    @Override
    public void updateById(TbContentCategory tbContentCategory) {
        int i = tbContentCategoryMapper.updateByPrimaryKeySelective(tbContentCategory);
    }

    @Override
    public void insert(TbContentCategory tbContentCategory) {
        tbContentCategoryMapper.insert(tbContentCategory);
    }

    @Override
    public void deleteAll(Long[] ids) {
        tbContentCategoryMapper.deleteAll(ids);
    }


}
